home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2006 May / PCpro_2006_05.ISO / files / mobile / fma-2.0-stable-setup.exe / {app} / sframework / plugins / MousePlus.vbs < prev    next >
Encoding:
Text File  |  2004-09-09  |  6.1 KB  |  127 lines

  1. 'FMA Script Framework Plugin
  2. 'MousePlus
  3. 'Control your mouse cursor and PC
  4. 'Needs AutoItX control!
  5.  
  6. 'TODO:
  7. '-nothing atm
  8.  
  9. Class MousePlus
  10.     
  11.     Private llist
  12.     Private m_Self
  13.     Private m_QuitDlg
  14.     
  15.     'Some info about the plugin
  16.     Public Property Get SHOWABLE 'Do I have a menu?
  17.         SHOWABLE    = True
  18.     End Property
  19.     Public Property Get TITLE 'What's my name?
  20.         TITLE       = "Mouse+"
  21.     End Property
  22.     Public Property Get DESCRIPTION 'What's my purpose?
  23.         DESCRIPTION = "Conotrol your mouse!"
  24.     End Property
  25.     Public Property Get AUTHOR 'Who created me?
  26.         AUTHOR      = "streawkceur (inspired by jbngar)"
  27.     End Property
  28.     Public Property Get URL 'Were can I be found? Where can you get more information?
  29.         URL = "http://fma.xinium.com/"
  30.     End Property
  31.     
  32.     'Who am I?
  33.     Public Property Let Self (s)
  34.         m_Self = s
  35.     End Property
  36.     Public Property Get Self
  37.         Self = m_Self
  38.     End Property
  39.     
  40.     'Display me. Eventually put a menu on the screen
  41.     Sub Show()
  42.         'Push empty menu to prevent switching pages of the previous menu
  43.         EmptyMenu.ShowMenu
  44.         PutDialogue
  45.         m_QuitDlg = False 'Don't quit the dialoge on Left Softkey and Joy Press. Only when the Back button is pressed!
  46.         'KeyPad
  47.         KeyManager.RegisterKey   KEY_1,         "Shell.SendKeys ""{TAB}""",                                     STATE_PRESS  , Me
  48.         KeyManager.RegisterKey   KEY_2,         "Shell.SendKeys ""{UP}""",                                      STATE_PRESS  , Me
  49.         KeyManager.RegisterKey   KEY_3,         "Shell.SendKeys ""{ESC}""",                                     STATE_PRESS  , Me
  50.         KeyManager.RegisterKey   KEY_4,         "Shell.SendKeys ""{LEFT}""",                                    STATE_PRESS  , Me
  51.         KeyManager.RegisterKey   KEY_5,         "Shell.SendKeys ""{DOWN}""",                                    STATE_PRESS  , Me
  52.         KeyManager.RegisterKey   KEY_6,         "Shell.SendKeys ""{RIGHT}""",                                   STATE_PRESS  , Me
  53.         KeyManager.RegisterKey   KEY_7,         Self & ".AltTabDown",                                           STATE_PRESS  , Me
  54.         KeyManager.RegisterKey   KEY_7,         Self & ".AltTabUp",                                             STATE_RELEASE, Me
  55.         KeyManager.RegisterKey   KEY_8,         "Shell.SendKeys ""{PGUP}""",                                    STATE_PRESS  , Me
  56.         KeyManager.RegisterKey   KEY_9,         "Shell.SendKeys ""{PGDN}""",                                    STATE_PRESS  , Me
  57.         KeyManager.RegisterKey   KEY_ASTERIX,   "Shell.SendKeys ""%{F4}""",                                     STATE_PRESS  , Me
  58.         KeyManager.RegisterKey   KEY_0,         "Shell.SendKeys ""~""",                                         STATE_PRESS  , Me
  59.         KeyManager.RegisterKey   KEY_SHARP,     Self & ".Input",                                                STATE_PRESS  , Me
  60.         KeyManager.RegisterKey   KEY_C,         "Shell.SendKeys ""{BACKSPACE}""",                               STATE_PRESS  , Me
  61.         KeyManager.RegisterKey   KEY_SOFTLEFT,  "ActiveXManager(""floAtMediaCtrl.MouseCtrl"").MouseLeftClick",  STATE_PRESS  , Me
  62.         KeyManager.RegisterKey   KEY_SOFTRIGHT, "ActiveXManager(""floAtMediaCtrl.MouseCtrl"").MouseRightClick", STATE_PRESS  , Me
  63.         KeyManager.RegisterKey   KEY_VOLUP,     "ActiveXManager(""floAtMediaCtrl.MouseCtrl"").MouseWhlUp",      STATE_PRESS  , Me
  64.         KeyManager.RegisterKey   KEY_VOLDOWN,   "ActiveXManager(""floAtMediaCtrl.MouseCtrl"").MouseWhlDown",    STATE_PRESS  , Me
  65.         KeyManager.RegisterKey   KEY_BACK,      Self & ".BackButton",                                           STATE_PRESS  , Me
  66.         'JoyStick
  67.         KeyManager.RegisterKey   KEY_JOYLEFT,   "ActiveXManager(""floAtMediaCtrl.MouseCtrl"").MouseMove ""W""", STATE_PRESS  , Me
  68.         KeyManager.RegisterKey   KEY_JOYUP,     "ActiveXManager(""floAtMediaCtrl.MouseCtrl"").MouseMove ""N""", STATE_PRESS  , Me
  69.         KeyManager.RegisterKey   KEY_JOYRIGHT,  "ActiveXManager(""floAtMediaCtrl.MouseCtrl"").MouseMove ""E""", STATE_PRESS  , Me
  70.         KeyManager.RegisterKey   KEY_JOYDOWN,   "ActiveXManager(""floAtMediaCtrl.MouseCtrl"").MouseMove ""S""", STATE_PRESS  , Me
  71.         KeyManager.RegisterKey   KEY_JOYPRESS,  "ActiveXManager(""floAtMediaCtrl.MouseCtrl"").MouseLeftClick",  STATE_PRESS  , Me
  72.         KeyManager.RegisterKey     KEY_JOYLEFT,   "ActiveXManager(""floAtMediaCtrl.MouseCtrl"").MouseStop",          STATE_RELEASE, Me
  73.         KeyManager.RegisterKey     KEY_JOYUP,     "ActiveXManager(""floAtMediaCtrl.MouseCtrl"").MouseStop",       STATE_RELEASE, Me
  74.         KeyManager.RegisterKey     KEY_JOYRIGHT,  "ActiveXManager(""floAtMediaCtrl.MouseCtrl"").MouseStop",       STATE_RELEASE, Me
  75.         KeyManager.RegisterKey     KEY_JOYDOWN,   "ActiveXManager(""floAtMediaCtrl.MouseCtrl"").MouseStop",       STATE_RELEASE, Me
  76.     End Sub
  77.     
  78.     Sub PutDialogue
  79.         'No Menu here. Just show information and register keys.
  80.         am.Back = Self & ".Quit" 'Mangage the menu quit by ourselves
  81.         am.DlgMsgBox "1:tab 2,5,4,6:cursor 3:esc 7:alt-tab 8,9:pgdn/up 0:enter *:alt-F4 #:text-input c:backsp back:exit", 0
  82.     End Sub
  83.     
  84.     Sub Input
  85.         'Unregister all our key events, we don't want to react on them in the Text Input dialogue
  86.         KeyManager.DeregisterAll Me
  87.         am.Back = Self & ".QuitInput" 'Mangage the menu quit by ourselves
  88.         am.DlgInputStr "Mouse+", "Prompt:", 64, "", Self & ".DlgInputStrResult"
  89.     End Sub
  90.     Sub DlgInputStrResult( input )
  91.         Shell.SendKeys input
  92.         'Show the menu and Register the keys
  93.         Show
  94.     End Sub
  95.     Sub QuitUnput
  96.         Show
  97.     End Sub
  98.     
  99.     Sub BackButton
  100.         m_QuitDlg = True
  101.     End Sub
  102.     
  103.     'Alt-TAB cycle
  104.     Sub AltTabDown
  105.         ActiveXManager("AutoItX.Control").Send "{ALTDOWN}{TAB}"
  106.         'Go through windows every second
  107.         fma.AddTimer 1000, "ActiveXManager(""AutoItX.Control"").Send ""{TAB}"""
  108.     End Sub
  109.     Sub AltTabUp
  110.         fma.DeleteTimer "ActiveXManager(""AutoItX.Control"").Send ""{TAB}"""
  111.         ActiveXManager("AutoItX.Control").Send "{ALTUP}"
  112.     End Sub
  113.     
  114.     Sub Quit
  115.         If m_QuitDlg Then 'Only quit when we are allowed to. And we're only allowed to quit, when the back button is pressed
  116.             'Unregister all our key events
  117.             KeyManager.DeregisterAll Me
  118.             'Remove emtpy menu
  119.             MenuStack.Top.Quit
  120.         Else
  121.             PutDialogue 'Repaint the dialogue that the back button is monitored again
  122.         End If
  123.     End Sub
  124.     
  125. End Class
  126.  
  127.